package appapi.Vo.record;

import appapi.entity.Zhongjiao.OnsiteinspectionDto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 请求对象
 *
 * @author luocheng
 * @version 1.0
 * @date 2023/06/05 10:31
 */
@ApiModel(value = "添加巡检请求对象")
@Data
public class OnSiteRecVo {
    @ApiModelProperty(value = "创建人名称")
    private String createUser;
    @ApiModelProperty(value = "记录ID")
    private Long onsitId;

    @ApiModelProperty(value = "巡检设备")
    private Long equipId;

    @ApiModelProperty(value = "巡检人员")
    private String operator;

    @ApiModelProperty(value = "巡检日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime onsiteDate;

    @ApiModelProperty(value = "巡检结果:0-通过;1-未通过")
    private Integer onsiteResult;

    @ApiModelProperty(value = "巡检备注")
    private String onsiteNote;

    @ApiModelProperty(value = "操作人员")
    private Long staffId;

    @ApiModelProperty(value = "整改要求")
    private String expRequire;

    @ApiModelProperty(value = "附件地址url")
    private List<String> annexUrl;

    @ApiModelProperty(value = "巡检详情")
    private List<OnSiteDetailVo> details;

    public OnsiteinspectionDto vo2Entity() {
        OnsiteinspectionDto entity = new OnsiteinspectionDto();
        BeanUtils.copyProperties(this, entity);
        return entity;
    }
}
